/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Database;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

/**
 *
 * @author owner
 */
public class Create_KantorCabang {

    public static void main(String[] args) throws SQLException, FileNotFoundException, IOException {
        Connection con;
        con = Koneksi.open();
        Statement stat = con.createStatement();

        String buat = "CREATE TABLE KANTOR_CABANG_T (ID_KANTOR_CABANG VARCHAR2(6) CONSTRAINT kc_id_pk PRIMARY KEY,"
                + "PASSWORD VARCHAR2(6),NAMA VARCHAR2(15))";
        stat.executeQuery(buat);
        System.out.println("table KANTOR_CABANG_T created");

        String in = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('JGJ','jgj','Yogyakarta')";
        stat.executeUpdate(in);
        String in1 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('JKT','jkt','Jakarta')";
        stat.executeUpdate(in1);
        String in2 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('SMG','smg','Semarang')";
        stat.executeUpdate(in2);
        String in3 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('SBY','sby','Surabaya')";
        stat.executeUpdate(in3);
        String in4 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('BDG','bdg','Bandung')";
        stat.executeUpdate(in4);
        String in5 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('LPG','lpg','Lampung')";
        stat.executeUpdate(in5);
        String in6 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('MDN','mdn','Medan')";
        stat.executeUpdate(in6);
        String in7 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('PLB','plb','Palembang')";
        stat.executeUpdate(in7);
        String in8 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('DPS','dps','Denpasar')";
        stat.executeUpdate(in8);
        String in9 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('LBK','lbk','Lombok')";
        stat.executeUpdate(in9);
        String in10 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('JYP','jyp','Jayapura')";
        stat.executeUpdate(in10);
        String in11 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('MKS','mks','Makassar')";
        stat.executeUpdate(in11);
        String in12 = "insert into KANTOR_CABANG_T(ID_KANTOR_CABANG,PASSWORD,NAMA)"
                + "values ('MAN','man','Manado')";
        stat.executeUpdate(in12);
        System.out.println("table terisi");
    }
}
